# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=cargo-flamegraph
pkgver=0.6.2
pkgrel=1
pkgdesc='Easy flamegraphs for Rust projects and everything else'
url="https://github.com/flamegraph-rs/flamegraph"
depends=('perf')
makedepends=('cargo')
arch=('loong64' 'x86_64')
license=('MIT' 'Apache')
source=(https://github.com/flamegraph-rs/flamegraph/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
b2sums=('20d31d2e9ee69d6a7c2214c6cccb1182a4f66cc6b2134b5844e8377ad49afea855cba5fd8bb8c80fb479c0948097bda97c248e681f9e56350de7a0624617a337')

build() {
  cd "flamegraph-${pkgver}"
  cargo build --release --locked
}

check() {
  cd "flamegraph-${pkgver}"
  cargo test --release --locked
}

package() {
  cd "flamegraph-${pkgver}"
  install -Dm755 -t "${pkgdir}/usr/bin" \
    target/release/cargo-flamegraph \
    target/release/flamegraph
  install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm644 LICENSE-MIT -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim:set ts=2 sw=2 et:
